/***************************************************************************
 *   Copyright (C) 2009 by Marian Skvarek   *
 *   skvarek.marian@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A TrackICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef EASYSCORE_GLOBALSCGLOBALS_H
#define EASYSCORE_GLOBALSCGLOBALS_H

#include <QColor>

#define DEBUG 0

/** note values ( value = relative duration like whole, half etc. ) */
typedef int NOTE_VALUE;
#define	NOTE_VALUE_LONGA 512
#define NOTE_VALUE_DOUBLE_WHOLE 256
#define NOTE_VALUE_WHOLE 128
#define NOTE_VALUE_HALF 64
#define NOTE_VALUE_QUARTER 32
#define NOTE_VALUE_EIGHTH 16
#define NOTE_VALUE_SIXTEENTH 8
#define NOTE_VALUE_THIRTYSECOND 4
#define NOTE_VALUE_SIXTYFOURTH 2
#define NOTE_VALUE_HUNDREDTWENTYEIGTH 1
#define NOTE_VALUE_UNKNOWN 0

typedef int NOTE_POSITION;
#define	NOTE_POSITION_C 0
#define	NOTE_POSITION_D 1
#define	NOTE_POSITION_E 2
#define	NOTE_POSITION_F 3
#define	NOTE_POSITION_G 4
#define	NOTE_POSITION_A 5
#define	NOTE_POSITION_H 6
#define NOTE_POSITION_OCTAVE 7;

typedef int NOTE_OCTAVE;


typedef int NOTE_PITCH;
#define	NOTE_PITCH_C 0
#define NOTE_PITCH_D 2
#define NOTE_PITCH_E 4
#define NOTE_PITCH_F 5
#define NOTE_PITCH_G 7
#define NOTE_PITCH_A 9
#define NOTE_PITCH_H 11
#define NOTE_PITCH_OCTAVE 12

//Tablature
typedef int FRETBOARD_POSITION;
#define POSITION_NONE -1
#define FRETBOARD_SIZE 24
#define POSITION_RANGE 4

typedef int STRING_NAME;
#define STRINGE5 0
#define STRINGH 1
#define STRINGG 2
#define STRINGD 3
#define STRINGA 4
#define STRINGE3 5
#define STRING_COUNT 6

#define PITCHE3 52
#define PITCHA3 57
#define PITCHD4 62
#define PITCHG4 67
#define PITCHH4 71
#define PITCHE5 76

namespace easyscore
{
    namespace globals
    {

        /**
		        @author Marian Skvarek <skvarek.marian@gmail.com>
		*/
        class CGlobals
        {
            //Accessors
        public:
            static QString getAppName() { return "EasyScore"; }
            static QString getAppVersion() { return "1.0.0"; }
            static QString getFullAppName() { return getAppName() + " v" + getAppVersion(); }
            static QString getProjectExtension() { return "eas"; }

            static double getDefaultZoomFactor() { return 0.1; }

            // Positions
            static int getUnitSymbolWidth() { return 80; }
            static int getSymbolHeight() { return getUnitSymbolWidth() * 17; }



            static int getPauseTopPadding() { return ( (getUnitSymbolWidth() * 10 ) / 2) + 20; }


            static int getBarLeftPadding() { return 0; }
            static int getBarRightPadding() { return 0; }
            static int getBarTopPadding() { return getUnitSymbolWidth() * 3; }
            static int getBarBottomPadding() { return getUnitSymbolWidth() * 3; }
            static int getRemoveBarControlSize() { return getUnitSymbolWidth() * 3; }
            static int getBarHeight() { return getBarTopPadding() + getSymbolHeight() + getBarBottomPadding();}
            static int getEmptyBarWidth() { return getBarLeftPadding() + getBarRightPadding(); }

            static int getTrackTopMargin() { return getUnitSymbolWidth() * 3; }
            static int getTrackLeftPadding() { return getUnitSymbolWidth() * 3; }
            static int getTrackTopPadding() { return getUnitSymbolWidth() *3; }
            static int getTrackRightPadding() { return getUnitSymbolWidth() * 3; }
            static int getTrackBottomPadding() { return getUnitSymbolWidth() *3; }
            static int getTrackClefWidth() { return getUnitSymbolWidth() * 3; }
            static int getTrackKeySignatureWidth() { return getUnitSymbolWidth() * 6; }
            static int getFirstMainLineTop() { return getTrackTopPadding() + 6 * CGlobals::getUnitSymbolWidth(); }

            static int getTrackHeight() { return getTrackTopPadding() + getBarHeight() + getTrackBottomPadding(); }
            static int getEmptyTrackWidth() { return getTrackLeftPadding() + getTrackClefWidth() + getTrackKeySignatureWidth() + getTrackRightPadding(); }
            static int getTrackFirstBarLeft() { return getTrackLeftPadding() + getTrackKeySignatureWidth() + getTrackClefWidth(); }

            static int getPartTopMargin() { return getUnitSymbolWidth() * 6; }
            static int getPartTopPadding() { return getUnitSymbolWidth() * 3; }
            static int getPartBottomPadding() { return getUnitSymbolWidth() * 3; }
            static int getPartLeftPadding() { return 0; }
            static int getPartRightPadding() { return 0; }

            static int getScoreTopPadding() { return getTrackHeight() /2; }
            static int getScoreBottomPadding() { return getTrackHeight() /2; }

            //Colors


        };

    }//namespace globals
}//namespace easyscore

#endif
